crypto: ecc - Fix NULL pointer deref. on no default_rng
authorPierre <pinaraf@pinaraf.info>
Sun, 12 Nov 2017 14:24:32 +0000 (15:24 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Sun, 18 Feb 2018 08:36:49 +0000 (08:36 +0000)
commitaf5de8689b18a055db2e837598baab559029d29b
tree5a352aae4b1d2185772c1569568557189c8454b8
parent6f03b36d5a4bb041cba4991d7641f00bf9aa8906
crypto: ecc - Fix NULL pointer deref. on no default_rng

If crypto_get_default_rng returns an error, the
function ecc_gen_privkey should return an error.
Instead, it currently tries to use the default_rng
nevertheless, thus creating a kernel panic with a
NULL pointer dereference.
Returning the error directly, as was supposedly
intended when looking at the code, fixes this.

Signed-off-by: Pierre Ducroquet <pinaraf@pinaraf.info>
Reviewed-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name crypto-ecc-fix-null-pointer-deref.-on-no-default_rng.patch
crypto/ecc.c